﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Runtime.Serialization;
using Newtonsoft.Json.Linq;

namespace QbservableCore.Serialization
{
    /// <summary>
    /// mapping can be use to compress the json length by replacing the default names into sorter or following some convention
    /// </summary>
    public interface IQbservableConvention 
    {
        /// <summary>
        /// Maps System.Type to convention.
        /// </summary>
        /// <param name="t">The System.Type </param>
        /// <returns></returns>
        string FromTypeToConvention(Type t);

        /// <summary>
        /// Maps the ExpressionType to convention.
        /// </summary>
        /// <param name="expType"></param>
        /// <returns></returns>
        string FromExpressionTypeToConvention(ExpressionType expType);

        /// <summary>
        /// Maps the key to convention.
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        string FromKeyToConvention(string key);


        /// <summary>
        /// Maps convention to type.
        /// </summary>
        /// <param name="nickType">Type of the nick.</param>
        /// <returns></returns>
        Type FromConventionToType(string convention);


        /// <summary>
        /// Maps convention to expression type.
        /// </summary>
        /// <param name="nickType">Type of the nick.</param>
        /// <returns></returns>
        //ExpressionType FromConventionToExpressionType(string convention);

        /// <summary>
        /// Maps convention to key.
        /// </summary>
        /// <param name="nickType">Type of the nick.</param>
        /// <returns></returns>
        string FromConventionToKey(string convention);

        /// <summary>
        /// Distinct Mapper Key.
        /// </summary>
        /// <value>
        /// The mapper key.
        /// </value>
        string ConventionKey { get; }

    }
}
